<link href="../addons/jy_yiliao/resource/css/weui.css" rel="stylesheet">
<link href="../addons/jy_yiliao/resource/css/zan.css" rel="stylesheet">
<style>
	html,
			body {
				position: static;
				height: auto;
				-webkit-overflow-scrolling: touch;
			}

			.single-page-container {
				position: static;
			}

			.page {
				position: fixed;
				top: 0;
				right: 0;
				bottom: 0;
				left: 0;
				z-index: 10;
			}

			.page.home {
				position: static;
			}

			.his-block-view .his-block-cell,
			.ps-item {
				list-style: none;
				display: inline-block;
				padding: 12px 0 11px 0;
				text-align: center;
				border: 1px solid #e6e6e6;
				border-radius: 2px;
				color: #333;
				margin: 0 0 12px 0;
				width: calc((100% - 20px) / 3);
				font-size: 13px;
			}

			.ps-item {
				margin: 0 12px 12px 0;
				padding: 12px 20px 11px 20px;
				width: auto;
			}

			.his-block-view .his-block-cell:nth-child(3n+2) {
				margin-left: 10px;
				margin-right: 10px;
			}

			textarea {
				background: #f5f5f5;
				border-radius: 2px;
			}

			.his-block-view .his-block-cell.lyb-active,
			.ps-item.lyb-active {
				color: #c03e3e;
				border-color: #c03e3e;
			}

			.weui-panel:before,
			.weui-panel:after,
			.weui-panel__hd:after {
				height: 0;
				border-bottom: none;
				border-top: none;
			}

			.weui-cells_checkbox .weui-icon-checked:before {
				font-size: 15px;
				color: #c03e3e !important;
			}

			.center {
				position: absolute;
				z-index: 1000;
				top: 50%;
				left: 50%;
				-webkit-transform: translate(-50%, -50%);
				transform: translate(-50%, -50%);
				width: calc(100% - 98px);
				background: url("//image-1252304461.file.myqcloud.com/image/sztk.png") left top repeat-y;
				-webkit-background-size: 100% 100%;
				background-size: 100% 100%;
				text-align: center;
				padding: 12px;
			}
			.telBox {
				line-height: 20px;
			}
			#wxPlusSource {
				font-size: 14px;
    			margin: 4px 12px;
				color: #c03e3e;
				line-height: 22px;
				display: none;
			}
			.schedule-tips {
				font-size: 14px;
				color: #c03e3e;
				margin: 0 12px;
				line-height: 30px;
				margin-bottom: 0;
			}
.yuyue-duan {border: 1px solid #ddd;width:auto;border-radius: 2px;padding:5px 10px;height:auto;margin:2px;font-size:15px;text-align:center;}
.yuyue-duan.active{color:#C03E3E}
.yuyue-duan span {width:100%;text-align:center}
</style>
<div class='fui-page order-create-page'>
  <div id="offCanvasWrapper" class="single-page-container">
			<div class="page home js_show">
				<div id="content" class="" style="padding-bottom: 50px;">
					<div class="user-bottom-bar marginBottom10 font15 padding-20-0 white-background" style="line-height: 1;">
						<div class="select-patient his-flex" style="padding: 0 12px;margin-bottom: 16px;">
							<div class="deep-color fontBold">患者信息</div>
							<div ng-click="pagedata.showbody=true" class="more red-color font13">选择患者</div>
						</div>
						<div class="deep-color" style="padding: 0 12px;">
							<div id="patient_info" class="deep-color">
								<div class="font15">{{pagedata.post.body.name}} | {{pagedata.post.body.year}}岁 | {{pagedata.post.body.sex}} | {{pagedata.user.mobile}}</div>
							</div>
						</div>
					</div>
					<div class="marginBottom10 font15 white-background" style="line-height: 1;padding-top: 20px;padding-bottom: 4px;">
						<div class="his-flex" style="padding: 0 12px;margin-bottom: 16px;">
							<div class="deep-color"><span class="fontBold">出诊信息</span>（{{pagedata.post.daydata}}）</div>
							<a class="more red-color font13" href="javascript:" ng-click="access_json('jy_yiliao/yuyue//workerid='+pagedata.post.workerid)">切换日期</a>
						</div>
						<div class="deep-color" style="padding: 0 12px;">
							<div id="schedule" class="deep-color font15">
								<span style="margin-right:0.3rem">{{pagedata.ontimes.start}}~{{pagedata.ontimes.end}}</span>
								<span style="margin-right:0.3rem">|</span>
								<span style="margin-right:0.5rem">{{pagedata.store.title}}</span>
								<span style="margin-right:0.5rem;color:#f60" ng-click="pagedata.openLocation(pagedata.store);"><i class="icon icon-map"></i> 查看地图</span>
							</div>
						</div>
					</div>
					<div id="maiXianTitle"></div>
					<div class="marginBottom10 white-background" style="padding: 8px 0 4px 0;">
						<div id="wxPlusSource">该时段为大夫加诊班次，可提交加诊申请，就诊前一日会有专属客服向您确认加诊是否成功，如果成功会告知您具体就诊时间。</div>

						<div style="display: flex;align-items: center;justify-content: space-between;">
							
							<div class="padding12 font15 fontBold">选择时段</div>
							<!--提示语句-->
							<div class="schedule-tips"></div>
						</div>
						<div class="weui_cells" style="padding: 0 12px;margin-top:0">
							<div ng-repeat="row in pagedata.serve_time" class="jy-3">
								<div ng-if="row.isman!=1" ng-class="{'yuyue-duan':1,'active':pagedata.post.ontimestart == row.start}" ng-click="pagedata.post.ontimestart=row.start;pagedata.post.ontime=timev;">
									<div>{{row.start}}~{{row.end}}</div>
									<div class="clear"></div>
								</div>
								<div ng-if="row.isman==1" class="yuyue-duan delete">
									<div>{{row.start}}~{{row.end}}</div>
									<div class="clear"></div>
								</div>
							</div>
						</div>
					</div>
					<!--<div id="pay_type" class="marginBottom10 white-background" style="padding: 8px 0;">
						<div class="padding12 font15 fontBold">支付方式 <span class="red-color font12" id="hykTip" style="display: none">（预约输入会员卡密码仅验证，不扣会员卡余额）</span></div>
						<div id="appoint_type" class="his-hide">
							<div id="appoint_type_border" class="his-after-line-left12 marginBottom8" style="padding: 0 12px 4px 12px;"></div>
							<div id="other_info" class="his-hide padding12 paddingTop8 paddingBottom8" style="display: flex;">
								<div class="weui-cell__hd marginRight8"><img src="//image-1252304461.file.myqcloud.com/image/pay/meal.png"
									 style="width: 36px;height: 36px;vertical-align: top;" /></div>
								<div class="weui-cell__bd">
									<div id="atName" style="margin-bottom: 8px;"></div>
									<div id="lest" class="red-color font10" style="margin-bottom: 8px;"></div>
									<div id="atTime" class="light-color font10"></div>
								</div>
							</div>
						</div>
						<div id="pay_type_border" class="red-color his-hide" style="padding: 8px 12px;">
							<div class="weui-cell" style="padding: 0;margin-top: 4px;">
								<div id="pay_type_selector" class="weui-cell__bd his-flex"></div>
								<div class="more font13 red-color his-right pay-selector" style="height: 36px;line-height: 36px;">切换支付方式
								</div>
							</div>
							<div id="kaitonghuiyuan" class="his-hide" style="margin-top: 22px;">
								<a href="">
									<img src="../../resources/images/personal_icon/kaitonghuiyuan.png" alt="" style="width: 100%;vertical-align: bottom;">
								</a>
							</div>
						</div>
						<div id="haveInsurTip" class="his-hide middle-color padding12 font12">保险客户请预付诊费，到店看诊后将根据您的实际保险额度退还</div>
					</div>-->
					<!--<div id="coupon" class="weui-cells weui-cell_access marginBottom10">
						<div class="weui-cell" style="padding: 16px 12px;">
							<div class="weui-cell__bd deep-color fontBold font15 lineHeight1">优惠券</div>
							<div id="coupon_view" class="weui-cell__ft light-color lineHeight1 font13" data-text=""></div>
						</div>
					</div>-->
					<div class="weui-panel marginBottom10 padding12">
						<div class="weui-panel__hd" style="padding: 8px 0;margin-bottom: 4px;">
							<span class="font15 fontBold deep-color">病情备注</span>
							<span class="font13 light-color">（选填）</span>
						</div>
						<div class="weui-panel__bd">
							<textarea id="remark" ng-model="pagedata.post.remark" class="weui-textarea question" rows="2" placeholder="描述病情，让大夫更了解您的情况"></textarea>
						</div>
					</div>
					<div class="white-background" style="padding: 20px 12px;">
						<div class="font15 fontBold deep-color" style="margin-bottom: 16px;">费用说明</div>
						<div class="middle-color">
							<p class="font13 marginBottom10">1. 使用会员卡，预约先不支付，到店结算</p>
							<p class="font13 marginBottom10">2. 使用套餐或专科预约，抵扣剩余次数（次数抵诊费）</p>
							<p class="font13 marginBottom10">3. 使用高端医疗险，预约先不支付，到店结算</p>
							<p class="font13 marginBottom10">4. 门店收费说明</p>
							<div id="fee_list" class="font12 marginBottom10" style="padding-left: 13px;"></div>
							<p class="font13">5. 购买即同意<a ng-click="pagedata.show_xieyi=true" class="agreement-link-color">《服务协议》</a></p>
						</div>
					</div>
					<p class="white-background" id="sanfutie" style="padding: 0px 12px 10px;font-size: 14px;line-height: 22px;display: none;">备注：预约看诊三伏贴大夫使用高端医疗险，需到店后确认福利是否承担此项责任<br/>三伏贴费用以实际到店结算为准</p>
				</div>
			</div>
			<div class="his-fixed-bottom his-flex his-before-line">
				<div class="his-flex his-flex-grow">
					<div class="" style="width: 52px;text-align: center;border-right: solid 1px #E6E6E6;">
						<a class="kefu-tel" href="tel:{{pagedata.pluginset.tel}}"></a>
					</div>
					<div class="paddingLeft20 font15 his-flex-grow">
						<span id="price" class="red-color">应付{{pagedata.post.price ||'0.00'}}元</span>
						<span id="discount" class="marginLeft10"></span>
					</div>
				</div>
				<button ng-if="!pagedata.order_id" ng-click="pagedata.pay_submit(pagedata.post,'jy_yiliao/create/post/','jy_yiliao/yuyue_order//status=1')" type="button" class="weui-btn weui-btn_mini weui-btn_warn his-buy-btn his-noborder">立即预约
				</button>
				<button ng-if="pagedata.order_id" ng-click="access_json('jy_yiliao/yuyue_order//status=1')" type="button" class="weui-btn weui-btn_mini weui-btn_warn his-buy-btn his-noborder">查看预约
				</button>
			</div>
		</div>
		<div id="six" class="his-hide">
			<div class="weui-mask weui-animate-fade-in"></div>
			<div class="center radius2" style="width: 90%;">
				<div class="marginBottom20 lineHeight20" style="text-align: left;color: #6C5D44;font-size: 14px">
					<span>此大夫参与儿童养护节活动。</span><br>
					<span>活动期间，16岁以下首诊儿童享受61元儿童关爱价，仅限前61名，先到先得。</span><br>
					<span>如果参加，请认真填写年龄，并在看诊时带好身份证件以供核实。</span>
				</div>
				<div onclick="this.parentNode.parentNode.classList.add('his-hide');" class="radius2 white-color padding-10-0" style="background: #D4A668;">我知道了
				</div>
			</div>
		</div>
<!-- body-->
<div ng-if="pagedata.showbody" class="popup">
			<div class="popup-body">
			<div class="popup-bottom">
				<i class="closed icon icon-cuowu" ng-click="pagedata.showbody=false"></i>
				<div class="fui-list-group" style="background:#fff;padding:0.25rem 0.5rem;margin-top:2rem">
					<div class="fui-list" ng-repeat="item in pagedata.list" style="border-radius:0.5rem;margin-bottom:0.3rem;background:#f2f2f2;padding:0.5rem">
					   <div class="fui-list-inner" style="margin-top:0.16rem" ng-click="pagedata.post.body = item;pagedata.showbody=false">
							<div class="title" style="font-size:0.76rem;height:2rem;line-height:2rem">
								<span>{{item.name}}</span>
								<span ng-if="item.isfa==1" style="padding-left:0.5rem">
								<div class="btn btn-sm btn-default-o order-delete">本人</div>
								</span>
							</div>
							<div class="subtitle" style="-webkit-line-clamp:2;height:1.5rem">
								{{item.year}}岁 | {{item.sex}} | {{item.mobile}}
							</div>
						</div>
					</div>
				</div>
			</div>
			</div>
</div>
<div ng-if="pagedata.show_xieyi" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" style="font-size:1.2rem;top:105%;" ng-click="pagedata.show_xieyi=false"></i>
			<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">{{pagedata.xieyi.title||'服务协议'}} / <small>Read Ggree</small></div>
					<div class="text" style="padding-top:0.5rem;font-size:0.7rem" ng-bind-html="trust(pagedata.xieyi.content)">
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.show_xieyi=false;pagedata.post.check=1" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
			</div>
		</div>
	</div>
</div>
<script language='javascript'>
scope.pagedata.pay_submit=function(post,post_url,complete_url){
	scope.post_json(post_url,post,function(result){
		scope.pagedata.order_id=result.order_id;
		scope.$evalAsync();
		scope.tool.pay(result.pay_id,function(res){
				if(res.type=='success'){
					scope.message(res.message,'success','/order/detail/fromcreate=1&payid='+result.pay_id);
				}else{
					scope.message(res.message,'success','/order/detail/fromcreate=1&payid='+result.pay_id);
				}
		},'','',complete_url,complete_url);
	});
}
scope.pagedata.getstores=function(lat_lng){
	scope.post_json('jy_yiliao/store_list/getlist/lat='+lat_lng.lat+'&lng'+lat_lng.lng,{},function(res){
			scope.pagedata.stores =res.list
			scope.pagedata.stores_count =res.stores_count
			scope.$evalAsync();
	});
}
if(!scope.pagedata.lat_lng && !scope.pagedata.lat_lng.lat){
	// 百度地图API功能
	window.scope.location(function(res){
		scope.pagedata.getstores(res.lat_lng);
	});
}else{
	scope.pagedata.getstores(scope.pagedata.lat_lng);
}
scope.pagedata.showstoreitem=function(){
	$('#showstoreitem').modal();
}
scope.pagedata.stores=function(index){
	scope.pagedata.post.store_id = scope.pagedata.list[index].id;
	scope.pagedata.store=scope.pagedata.list[index]
	$('#showstores').modal('hide');
}
scope.tool.get_list('jy_yiliao/body_list/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_yiliao/body_list/getlist/');
}
scope.pagedata.openLocation=function(item){
	wx.openLocation({
	latitude: item.lat_lng.lat, // 纬度，浮点数，范围为90 ~ -90
	longitude: item.lat_lng.lng, // 经度，浮点数，范围为180 ~ -180。
		name: item.province+item.city+item.district, // 位置名
		address: item.address, // 地址详情说明
		scale: 20, // 地图缩放级别,整形值,范围从1~28。默认为最大
		infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
		success:function(){
			//alert(1111);
		}
	});
}
scope.getserve_time = function(){
		var params1 = {
					'plugin':'jy_yiliao',
					'action':'create',
					'op':'serve_time',
					'data':scope.pagedata.post,
					'callback':function(data){
							console.log('getserve_time');console.log(data)
							if(data.success == 1){
									scope.pagedata.canbuy=false;
									scope.pagedata.ontimes = data.ontimes;
									scope.pagedata.store = data.store;
									scope.pagedata.post.ontimestart=data.serve_time[0]['start']
									scope.pagedata.serve_time = data.serve_time;
									scope.$evalAsync();
							}
					}
		}
		scope.post_json(params1);
}
scope.getserve_time();
</script>

</div>
<div ng-include="sys_html('common/_footer')"></div>